package im.xz.cn.xiacore.methods;
import org.bukkit.entity.Player;
public class rank {
    public static int getRank(Player player) {
        int rankLevel = 0;
        boolean iron = player.hasPermission("xzrui.rank.iron");
        boolean gold = player.hasPermission("xzrui.rank.gold");
        boolean diamond = player.hasPermission("xzrui.rank.diamond");
        boolean goldApple = player.hasPermission("xzrui.rank.goldApple");
        try {
            if (player.hasPermission("xzrui.ranl.root")) {
                rankLevel = 621;
            }else if (goldApple) {
                rankLevel = 4;
            }else if (diamond & !goldApple) {
                rankLevel = 3;
            }else if (gold & !diamond & !goldApple) {
                rankLevel = 2;
            }else if (iron & !gold & !diamond & !goldApple) {
                rankLevel = 1;
            }
        }catch (NullPointerException ignore) {

        }
        return rankLevel;
    }
}